/*----------------------------------------------------------------------------\
                                 进度条
                          20050905  Li Yupeng

 本 JS 需要用到 progressbar.css 文件
 调用：<script type="text/javascript" src="/js/common/progressbar.js"></script>

\----------------------------------------------------------------------------*/

/**
* 加入CSS文件
*/
document.write("<link type=\"text/css\" rel=\"StyleSheet\" href=\"/css/progressbar.css\" /> ");

/**
* 显示进度条
*/
//function showProgressBar(win) {
//  var progressBar;
//  progressBar=win.document.getElementById("ProgressBarDiv");
//  if(progressBar!=null)
//  {
//    progressBar.style.display="block";
//  }
//}
function showProgressBar(win) {
  var progressBar;
  progressBar=win.document.getElementById("ProgressBarDiv");
  if(progressBar!=null)
  {
    progressBar.style.display="block";
    setTimeout("hiddenProgressBar(this)",18000);
  }
}
/**
* 隐藏进度条
*/
function hiddenProgressBar(win) {
  var progressBar;
  progressBar=win.document.getElementById("ProgressBarDiv");
  if(progressBar!=null)
  {
    progressBar.style.display="none";
  }
}

/**
* 进度条
*/
function writeprogressbar(win){
 if (win!=null){
     if(win.document.getElementById("ProgressBarDiv")==null)
     {
         var progressDivStr=" <div class=\"ProgressBar\" id=\"ProgressBarDiv\" " +
                     " style=\"height:90px; width:300px; display:block;\"> " +
                     " <center><span class=\"title\">系统正在处理，请等候……</span> " +
                     " <marquee direction=\"right\" scrollamount=\"4\" scrolldelay=\"100\"> " +
                     " <span class=\"Handle-0\"></span> " +
                     " <span class=\"Handle-1\"></span> " +
                     " <span class=\"Handle-2\"></span> " +
                     " <span class=\"Handle-3\"></span> " +
                     " <span class=\"Handle-4\"></span> " +
                     " <span class=\"Handle-5\"></span> " +
                     " <span class=\"Handle-6\"></span> " +
                     " <span class=\"Handle-7\"></span> " +
                     " <span class=\"Handle-8\"></span> " +
                     " <span class=\"Handle-9\"></span> " +
                     " </marquee></center> " +
                     " </div> ";
          win.document.write(progressDivStr);
     }
     var progressBar=win.document.getElementById("ProgressBarDiv");
     if(progressBar!=null)
     {
          //用于把层放到浏览器中间
          progressBar.style.left=((win.document.body.offsetWidth-parseFloat(progressBar.style.width))/2)+win.document.body.scrollLeft;
          progressBar.style.top=((win.document.body.offsetHeight-parseFloat(progressBar.style.height))/2)+win.document.body.scrollTop;
          progressBar.style.display="none";
     }
 }
}

writeprogressbar(this);
//showProgressBar(this);
//hiddenProgressBar(this);
